/**
 * @FilePath     : /YOLOv8Seg-ONNXRuntime-CPP/src/main.cpp
 * @Description  :  
 * @Author       : desyang
 * @Date         : 2025-06-05 20:10:46
 * @LastEditors  : desyang
 * @LastEditTime : 2025-06-17 15:46:49
**/
#include <iostream>
#include <opencv2/opencv.hpp>

#include "hik_camera.h"
// 使用示例
int main() {
    HikCamera camera;
    
    // 连接相机
    if (!camera.Connect()) {
        std::cerr << "Failed to connect camera!" << std::endl;
        return -1;
    }
    
    // 开始采集
    if (!camera.StartGrabbing()) {
        std::cerr << "Failed to start grabbing!" << std::endl;
        return -1;
    }
    
    // 连续采集10帧
    for (int i = 0; i < 1000; ++i) {
        cv::Mat frame = camera.GrabFrame();
        cv::resize(frame, frame, cv::Size(), 0.4, 0.4);
        if (!frame.empty()) {
            cv::imshow("Hikvision Camera", frame);
            cv::waitKey(1);
        }
    }
    
    // 清理资源
    camera.Disconnect();
    return 0;
}


